//
//  KQMessageQuestionContent.swift
//  KangYunYouJia
//
//  Created by zhouxiang on 2020/12/17.
//  Copyright © 2020 zhoux@zzkqdc.com. All rights reserved.
//

import UIKit
import KakaJSON

class KQMessageQuestionContent: NSObject, KQMessageContentType ,Convertible{

    required override init() {}
    /// <#Description#>
    var parentsId: NSNumber?
    /// <#Description#>
    var answer: String?
    /// <#Description#>
    var url: String?
    /// <#Description#>
    var id: NSNumber?
    /// <#Description#>
    var phone: String?
    /// <#Description#>
    var children: [KQMessageQuestionContent]?
    /// <#Description#>
    var question: String?
    /// <#Description#>
    var hasChild: Bool?
    /// 1 打电话，2 url，3 问答
    var questionMsgType: KQQuestionMsgTypeModel?
    /// <#Description#>
    var keyWords: String?
    
    public weak var delegate: KQMessageDelegate?
    /// 这里left设置-5，是因为KQMessageStyle .custom方式会有 5的偏移量
    open var layoutMargins: UIEdgeInsets = UIEdgeInsets(top: 0, left: -5, bottom: 0, right: 0)
    
    open class var viewType: KQMessageContentViewType.Type {
        return KQMessageQuestionContentView.self
    }
    
    
    open func sizeThatFits(_ size: CGSize) -> CGSize {
        let height = KQMessageQuestionContentView.getTotalHeight(title: self.question, list: self.children)
        return CGSize(width: 250.0, height: height)
    }
    
}

class KQQuestionMsgTypeModel: NSObject, Convertible  {

    required override init() {}
    /// <#Description#>
    var name: String?
    /// 1 打电话，2 url，3 问答
    var code: String?

}


